home *** CD-ROM | disk | FTP | other *** search
/ Creative Computers / Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso / commercial / visual_inspirations / mlm / rexx / ppagelabels.rexx < prev    next >
OS/2 REXX Batch file  |  1994-11-17  |  3KB  |  106 lines

  1. /*
  2.                             PPageEnvelope.Rexx
  3.                            Written By J.L. White
  4.                         (C) 1993 Merlin's Software
  5.  
  6.            For Use With Mailing List Manager & Professional Page
  7.                        Print Envelopes From Database
  8. */
  9.  
  10. Font = "Times" 
  11. FontSize1 = 10
  12. LabelsPerPage = 20
  13. CR = '0a'x
  14. arg Total
  15.  
  16. call SetUp
  17. call ppm_PPageToFront()
  18. call MakePages
  19. call PickPrint
  20. call ppm_New()
  21. call ppm_PPageToBack()
  22. exit
  23.  
  24. SetUp:
  25.     FileName = "RAM:MLM.Temp"
  26.     call ppm_New()
  27.     ppm_CreatePage(1,1,1,1,0)
  28.     ppm_DeleteBox(1)
  29.     call ppm_SetFont(Font)
  30.     call ppm_SetStyle(B)
  31.     call ppm_SetJustification(0)
  32.     call ppm_SetSize(FontSize1)
  33. return
  34.  
  35.  
  36. MakePages:
  37.     Position = ppm_Inform(2,"Indent Label Text?","NO","YES");
  38.     Numeric Digits 3
  39.     TempTotal = Total / LabelsPerPage
  40.     Numeric Digits 1
  41.     TotalPages = Total / LabelsPerPage
  42.     if TempTotal > TotalPages then TotalPages = TotalPages + 1
  43.     if Position = 0 then do
  44.         Box1 = ppm_CreateBox(0.3000,0.6200,3.8500,9.9850,0)
  45.         Box2 = ppm_CreateBox(4.3800,0.6200,3.8500,9.9850,0)
  46.         end
  47.     if Position = 1 then do
  48.         Box1 = ppm_CreateBox(0.9000,0.6200,3.2500,9.9850,0)
  49.         Box2 = ppm_CreateBox(4.9800,0.6200,3.2500,9.9850,0)
  50.         end
  51.     ppm_LinkBox(Box1,Box2)
  52.     ppm_SelectBox(Box1)
  53.     BoxA = Box2
  54.     do i = 2 to TotalPages
  55.         ppm_CopyPage(1,Total,1)
  56.         ppm_GotoPage(i)
  57.         BoxB = ppm_DocNextBox(BoxA)
  58.         ppm_LinkBox(BoxA,BoxB)
  59.         NewBox = ppm_DocNextBox(BoxB)
  60.         ppm_LinkBox(BoxB,NewBox)
  61.         BoxA = NewBox
  62.     end
  63.     ppm_GotoPage(1)
  64.     ppm_SelectBox(Box1)
  65.     ppm_ImportText(Box1,FileName)
  66. return
  67.  
  68. PickPrint:
  69.     TypePrint=ppm_Inform(2,"Postscript Or Preference Printer","PREFERENCE PRINTER","POSTSCRIPT")
  70.     if TypePrint = 1 then call PostPrint
  71.     if TypePrint = 0 then call PrefPrint
  72. return
  73.  
  74. PostPrint:
  75.     OutPut = ppm_Inform(3,"Select Type Of Output To Use?","DISK","SER:","PAR:");
  76.     if OutPut = 2 then TypeOutPut = "PAR:"
  77.     if OutPut = 1 then TypeOutPut = "SER:"
  78.     if OutPut = 0 then do
  79.         TypeOutPut = ppm_GetUserText(50,"Enter Name For Output File!")
  80.         if TypeOutPut = "" then call NoPrint
  81.         end
  82.     call ppm_SetPSOutput(TypeOutPut)
  83.     Manual = ppm_Inform(2,"Manual Feed ON-OFF?","OFF","ON")
  84.     call ppm_SetPSManFeed(Manual)
  85.     NumCopy =  ppm_GetUserText(3,"Enter # Of Copies To Print!")
  86.     if NumCopy < 1 then call NoPrint
  87.     if NumCopy > 0 then ppm_PrintDocPS(NumCopy,1)
  88. return
  89.  
  90.  
  91. PrefPrint:
  92.     Eject=ppm_Inform(2,"Eject Page ON-OFF?","OFF","ON")
  93.     call ppm_SetDMEject(Eject)
  94.     NumCopy =  ppm_GetUserText(3,"Enter # Of Copies To Print!")
  95.     if NumCopy < 1 then call NoPrint
  96.     call ppm_PrintDocDM(NumCopy,1)
  97. return
  98.  
  99. NoPrint:
  100.     ppm_Inform(1,"Printing Has Been Cancelled!","OK")
  101.     call ppm_PPageToBack()
  102.     call ppm_New()
  103.     exit
  104. return
  105.  
  106.